﻿<%@ Page Language="C#" MasterPageFile="~/IPMSMasterPage.master" AutoEventWireup="true" 
CodeFile="OptAgents.aspx.cs" Inherits="OptAgents" Title="Project Monitoring System" 
Culture="auto:en-US" UICulture="auto" meta:resourcekey="PageResource1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server" Visible="false"/>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <div style="margin-left:10px;margin-right:10px;">
        <asp:Panel ID="panelSearch" runat="server">
            <fieldset>
                <legend>
                    <asp:Label ID="lblSearch" runat="server" Text="Search" meta:resourcekey="lblSearchResource1"></asp:Label>
                </legend>
                <table>
                    <tr>
                        <td width="60" align="left">
                            <asp:Label ID="lblSearchAgent" runat="server" Text="Agent" meta:resourcekey="lblSearchAgentResource1"></asp:Label>
                        </td>
                        <td width="200" align="left">
                            <asp:TextBox ID="txtSearchAgent" runat="server"></asp:TextBox>
                        </td>
                        <td width="100" align="left">
                            <asp:Label ID="lblSearchChineseName" runat="server" Text="Chinese Name" meta:resourcekey="lblSearchChineseNameResource1"></asp:Label>
                        </td>
                        <td width="200" align="left">
                            <asp:TextBox ID="txtSearchChineseName" runat="server"></asp:TextBox>
                        </td>
                        <td></td>
                    </tr>
                    <tr>
                        <td align="left">
                            <asp:Label ID="lblSearchName" runat="server" Text="Name" meta:resourcekey="lblSearchNameResource1"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtSearchName" runat="server"></asp:TextBox>
                        </td>
                        <td align="left">
                            <asp:Label ID="lblSearchContactPerson" runat="server" Text="Contact Person" meta:resourcekey="lblSearchContactPersonResource1"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtSearchContactPerson" runat="server"></asp:TextBox>
                        </td>
                        <td>
                            <asp:Button ID="btnSearch" runat="server" CssClass="submit" Text="Search" CausesValidation="false" meta:resourcekey="btnSearchResource1" onclick="btnSearch_Click"/>
                            <asp:Button ID="btnNewAgent" runat="server" CausesValidation="False" CssClass="submit" Text="New Agent" meta:resourcekey="btnNewAgentResource1" onclick="btnNewAgent_Click"/>
                       </td>         
                    </tr>
                </table>
            </fieldset>
        </asp:Panel>
        <table width="100%">
            <tr>
                <td align="center" width="100%">
                    <asp:Label ID="lblError" runat="server" ForeColor="Red" Width="100%" CssClass="error" meta:resourcekey="lblErrorResource1"></asp:Label>
                </td>
            </tr>
        </table>
        <asp:Panel ID="panelActive" runat="server" meta:resourcekey="ActivePanelResource1">
            <fieldset>
                <legend>
                    <asp:Label ID="lblActive" runat="server" Text="Active Agents" meta:resourcekey="lblActiveResource1"></asp:Label>
                </legend>
                <table>
                    <tr>
                        <td>
                            <asp:GridView CssClass="Grid" ID="gvActive" runat="server" 
                                BackColor="#DEBA84" BorderColor="#660000"
                                BorderStyle="Solid" BorderWidth="1px" CellPadding="0" CellSpacing="0" Width="100%"
                                Height="1%" AllowPaging="True" PageSize="10" AllowSorting="True" 
                                EmptyDataText="No Agent Record Aavailable!"
                                AutoGenerateColumns="False" meta:resourcekey="gvActiveResource1" 
                                DataKeyNames="Agent"
                                onpageindexchanging="gvActive_PageIndexChanging" 
                                onrowcommand="OnRowCommand">
                                <Columns>
                                    <asp:BoundField DataField="Agent" HeaderText="Agent" HeaderStyle-Width="100" ItemStyle-HorizontalAlign="left" ItemStyle-Wrap="false" meta:resourcekey="BoundFieldResource1"/>
                                    <asp:BoundField DataField="Name" HeaderText="Name" HeaderStyle-Width="100"  ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource2"/>
                                    <asp:BoundField DataField="ChineseName" HeaderText="Chinese Name" HeaderStyle-Width="100" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource3"/>
                                    <asp:BoundField DataField="Address" HeaderText="Address" HeaderStyle-Width="150" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource4"/>
                                    <asp:BoundField DataField="ContactPerson" HeaderText="Contact Person" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource5"/>
                                    <asp:BoundField DataField="JobTitle" HeaderText="Job Title" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource6"/>
                                    <asp:BoundField DataField="Phone" HeaderText="Phone Number" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource7"/>
                                    <asp:BoundField DataField="Fax" HeaderText="Fax Number" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource8"/>
                                    <asp:BoundField DataField="UpdateIP" HeaderText="IP Address" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource9"/>
                                    <asp:BoundField DataField="UpdateBy" HeaderText="Updated By" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource10"/>
                                    <asp:BoundField DataField="UpdateDate" HeaderText="Last Update Date" HeaderStyle-Width="200" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource11"/>
                                    <asp:TemplateField HeaderText="" ItemStyle-Width="60" ItemStyle-HorizontalAlign="center">
                                        <ItemTemplate>
                                            <a href="OptAgentsUpdate.aspx?Agent=<%# Eval("Agent")%>"><img src="Images/icon-edit.gif" border="0" /></a>
                                            <asp:ImageButton ID="imgBtnDelete" CommandName="halfDelete" OnClientClick="javascript:return confirm('Do you want to delete the record?');" runat="server" ImageUrl="Images/icon-delete.jpg"/>
                                        </ItemTemplate>
                                    </asp:TemplateField>
                               </Columns>
                                <HeaderStyle CssClass="GridHeaderStyle"/>
                                <RowStyle CssClass="GridRowStyle" />
                                <AlternatingRowStyle CssClass="GridAltRowStyle" />
                                <SelectedRowStyle CssClass="GridSelectedRowStyle" />
                                <PagerStyle CssClass="GridPagerStyle" ForeColor="White" />
                                <FooterStyle CssClass="GridFooterStyle" />
                            </asp:GridView>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </asp:Panel>
        <asp:Panel ID="panelDeleted" runat="server" meta:resourcekey="ActivePanelResource1">
            <fieldset>
            <legend>
                <asp:Label ID="lblDeleted" runat="server" Text="Deleted Agents" meta:resourcekey="lblDeletedResource1"></asp:Label>
            </legend>
            <table>
                <tr>
                    <td>
                        <asp:GridView CssClass="Grid" ID="gvDeleted" runat="server" 
                            BackColor="#DEBA84" BorderColor="#660000"
                            BorderStyle="Solid" BorderWidth="1px" CellPadding="0" CellSpacing="0" Width="100%"
                            Height="1%" AllowPaging="True" PageSize="10" AllowSorting="True" 
                            EmptyDataText="No Deleted Agent Record Available!"
                            AutoGenerateColumns="False" meta:resourcekey="gvActiveResource1" 
                            onpageindexchanging="gvDeleted_PageIndexChanging"
                            DataKeyNames="Agent"
                            onrowcommand="OnRowCommand">
                            <Columns>
                                <asp:BoundField DataField="Agent" HeaderText="Agent" HeaderStyle-Width="100" ItemStyle-HorizontalAlign="left" ItemStyle-Wrap="false" meta:resourcekey="BoundFieldResource14"/>
                                <asp:BoundField DataField="Name" HeaderText="Name" HeaderStyle-Width="100" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource15"/>
                                <asp:BoundField DataField="ChineseName" HeaderText="Chinese Name" HeaderStyle-Width="100" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource16"/>
                                <asp:BoundField DataField="Address" HeaderText="Address" HeaderStyle-Width="150" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource17"/>
                                <asp:BoundField DataField="ContactPerson" HeaderText="Contact Person" HeaderStyle-Width="100" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource18"/>
                                <asp:BoundField DataField="JobTitle" HeaderText="Job Title" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource19"/>
                                <asp:BoundField DataField="Phone" HeaderText="Phone Number" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource20"/>
                                <asp:BoundField DataField="Fax" HeaderText="Fax Number" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource21"/>
                                <asp:BoundField DataField="DeleteIP" HeaderText="IP Address" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource22"/>
                                <asp:BoundField DataField="DeleteBy" HeaderText="Deleted By" ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource23"/>
                                <asp:BoundField DataField="DeleteDate" HeaderText="Delete Date" HeaderStyle-Width="200"  ItemStyle-HorizontalAlign="left" meta:resourcekey="BoundFieldResource24"/>
                                <asp:TemplateField ItemStyle-Width="60" ItemStyle-HorizontalAlign="center">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="lbtnRestore" CommandName="Restore" runat="server" ImageUrl="Images/icon-restore.jpg"/>
                                        <asp:ImageButton ID="lbtnFroceDelete" CommandName="ForceDelete" OnClientClick="javascript:return confirm('Do you want to trash the record?');" runat="server" ImageUrl="Images/icon-trash.gif"/>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <HeaderStyle CssClass="GridHeaderStyle"/>
                            <RowStyle CssClass="GridRowStyle" />
                            <AlternatingRowStyle CssClass="GridAltRowStyle" />
                            <SelectedRowStyle CssClass="GridSelectedRowStyle" />
                            <PagerStyle CssClass="GridPagerStyle" ForeColor="White" />
                            <FooterStyle CssClass="GridFooterStyle" />
                        </asp:GridView>
                    </td>
                </tr>
            </table>
            </fieldset>
        </asp:Panel>
    </div>
</asp:Content>
